package offical.baseClass

/**
 * 包级函数的私有化只在kt文件中可见
 */
private fun privateTestFun() {

}

public var test: Int = 5 //包级属性随处可见
//setter 只在kt中可见
    private set(value) {
        field = value + 10
    }

open class Outer {

    protected open val b = 2
    //默认public
    val id = 3

    //嵌套类  ，相当于java static class
    class Nested {
        val visible = "visible"
        //Kotlin 中外部类不能访问内部类的 private 成员
        private val inVisible = "inVisible"
    }
}

class SubClass : Outer() {

    //这里没有显示指定可见性修饰符，默认使用父类的protected
    override val b: Int
        get() = super.b
}

class Unrelated(o: Outer) {

    init {
        o.id
        val visible = Outer.Nested::visible
    }
}


fun main(args: Array<String>) {

    Outer.Nested().visible
}

